package com.stupro.cjlu.service;

import com.stupro.cjlu.common.vo.ResultVO;
import com.stupro.cjlu.dao.CourseDAO;
import com.stupro.cjlu.dao.StudentCourseDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Administrator
 * @since 2021-05-10
 */
@Service
public class CourseService extends BaseService{

    @Autowired
    private CourseDAO courseDAO;

    @Autowired
    private StudentCourseDAO studentCourseDAO;

    @Transactional
    public ResultVO delCourseByCourseId(int id){
        studentCourseDAO.deleteByCourseId(id);
        return result(courseDAO.delById(id));
    }

}
